#pragma once

#include <mutex>
namespace Hi {
class HiAutoIncrease {
  public:
    HiAutoIncrease() : key(0) {}
    HiAutoIncrease(long first) : key(first) {}

  public:
    long get() {
        std::unique_lock<std::mutex> lck(mutex_);
        key++;
        if (key > 10000000000) {
            key = 0;
        }
        return key;
    }

  private:
    long key;
    std::mutex mutex_;
};
} // namespace Hi